package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

public enum FuiouProRspCodeEnum {

    SUCCESS("0000","成功"),
    TARGET_TIMEOUT("200001","目标方超时"),
    TARGET_CONNECT_TIMEOUT("200002","目标方连接失败"),
    TRADE_TIMEOUT("200098","交易超时"),
    MESSAGE_TIMEOUT("2001","无此账户,与发卡行通信超时"),
    PAYMENT_TIMEOUT("24PP","通道超时"),
    UNKNOW_STATE("999999","交易状态不明,请查询发卡行"),
    DEALING("P000", "支付处理中"),

    FREQUENT_REQ("1008","请求短信频繁,请稍后再试"),
    VERIFY_CODE_OVER_LIMIT("8110","请求验证码次数超限"),
    ERROR_VERIFY_CODE_OR_EXPIRE("8143","验证码失效或错误");

    public static boolean isToConfirm(String value) {
        if (StringUtils.isBlank(value)) {
            return false;
        }
        if (value.equals(TARGET_TIMEOUT.getValue()) || value.equals(TARGET_CONNECT_TIMEOUT.getValue()) || value.equals(TRADE_TIMEOUT.getValue()) || value.equals(MESSAGE_TIMEOUT.getValue()) ||
                value.equals(PAYMENT_TIMEOUT.getValue()) || value.equals(UNKNOW_STATE.getValue()) || value.equals(DEALING.getValue())) {
            return true;
        }
        return false;
    }

    private String value;
    private String desc;

    private FuiouProRspCodeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }


}
